package com.young.shop.pojo.vo;

/**
 * 标准内容返回对象类型
 */
public class BaseRespVO<T> {

    private int code;

    private String msg;

    private T data;

    public BaseRespVO succcess(T data){
        this.code = 200;
        this.data=data;
        return this;
    }

    public BaseRespVO failed(String msg){
        this.code = 0;
        this.msg=msg;
        return this;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    @Override
    public String toString() {
        return "BaseRespVO{" +
                "code=" + code +
                ", msg='" + msg + '\'' +
                ", data=" + data +
                '}';
    }

    public class CodeType {
    }
}
